package com.glenet.salary.action;

import java.util.List;

import com.glenet.salary.dao.HrSubTemplateDao;
import com.glenet.salary.entities.HrSubTemplate;

/**
 * @author MeiWenhui
 * 
 */
@SuppressWarnings("serial")
public class HrSubTemplateAction extends BaseAction {

	private HrSubTemplateDao templateDao = new HrSubTemplateDao();
	private HrSubTemplate subTemplate;
	private List<HrSubTemplate> list;

	public List<HrSubTemplate> getList() {
		return list;
	}

	public void setList(List<HrSubTemplate> list) {
		this.list = list;
	}

	public String save() {
		System.out.println(subTemplate.getTpl());
		templateDao.save(subTemplate);
		return SUCCESS;
	}
	
	public String add() {
		return SUCCESS;
	}

	public String execute() throws Exception {
		list = templateDao.list(0, Integer.MAX_VALUE);
		return SUCCESS;
	}

	public HrSubTemplate getSubTemplate() {
		return subTemplate;
	}

	public void setSubTemplate(HrSubTemplate subTemplate) {
		this.subTemplate = subTemplate;
	}

}
